package com.ruoyi.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.domain.BeCompleted;
import com.ruoyi.mapper.BeCompletedMapper;
import com.ruoyi.service.IBeCompletedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 竣工资料Service业务层处理
 *
 * @author ruoyi
 * @date 2020-06-24
 */
@Service
public class BeCompletedServiceImpl implements IBeCompletedService {
    @Autowired
    private BeCompletedMapper beCompletedMapper;

    /**
     * 查询竣工资料
     *
     * @param beId 竣工资料ID
     * @return 竣工资料
     */
    @Override
    public BeCompleted selectBeCompletedById(Long beId) {
        return beCompletedMapper.selectBeCompletedById(beId);
    }

    /**
     * 查询竣工资料列表
     *
     * @param beCompleted 竣工资料
     * @return 竣工资料
     */
    @Override
    public List<BeCompleted> selectBeCompletedList(BeCompleted beCompleted) {
        return beCompletedMapper.selectBeCompletedList(beCompleted);
    }

    @Override
    public List<BeCompleted> selectBeCompletedLists(Long sid) {
        return beCompletedMapper.selectBeCompletedLists(sid);
    }

    /**
     * 新增竣工资料
     *
     * @param beCompleted 竣工资料
     * @return 结果
     */
    @Override
    public int insertBeCompleted(BeCompleted beCompleted) {
        beCompleted.setBeTime(new Date());
        return beCompletedMapper.insertBeCompleted(beCompleted);
    }

    /**
     * 修改竣工资料
     *
     * @param beCompleted 竣工资料
     * @return 结果
     */
    @Override
    public int updateBeCompleted(BeCompleted beCompleted) {
        return beCompletedMapper.updateBeCompleted(beCompleted);
    }

    /**
     * 删除竣工资料对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBeCompletedByIds(String ids) {
        return beCompletedMapper.deleteBeCompletedByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除竣工资料信息
     *
     * @param beId 竣工资料ID
     * @return 结果
     */
    @Override
    public int deleteBeCompletedById(Long beId) {
        return beCompletedMapper.deleteBeCompletedById(beId);
    }

    /**
     * 根据资料类型和外键查询
     *
     * @param beType  类型
     * @param bePro  外键
     * @return 结果
     */
    @Override
    public List<BeCompleted> selectTypePro(Long beType, Long bePro) {
        return beCompletedMapper.selectTypePro(beType,bePro);
    }

    /**
     * 导出所有
     *
     * @param beCompleted 用户信息
     * @return 用户信息集合信息
     */
    @Override
    public List<BeCompleted> selectUserexport(BeCompleted beCompleted) {
        return beCompletedMapper.selectUserexport(beCompleted);
    }
}
